# >>> a = 1
# >>> type(a)
# <class 'int'>
# >>> b = 3.3
# >>> type(b)
# <class 'float'>
# >>> c = -5+4j
# >>> type(c)
# <class 'complex'>
# >>> dir(c)
# ['__abs__', '__add__', '__bool__', '__class__', '__delattr__', '__dir__',
# '__divmod__', '__doc__', '__eq__', '__float__', '__floordiv__', '__format__', '__ge__',
# '__getattribute__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__init_subclass__',
# '__int__', '__le__', '__lt__', '__mod__', '__mul__', '__ne__', '__neg__', '__new__', '__pos__',
# '__pow__', '__radd__', '__rdivmod__', '__reduce__', '__reduce_ex__', '__repr__', '__rfloordiv__',
# '__rmod__', '__rmul__', '__rpow__', '__rsub__', '__rtruediv__', '__setattr__', '__sizeof__',
# '__str__', '__sub__', '__subclasshook__', '__truediv__', 'conjugate', 'imag', 'real']
# >>> c.imag
# 4.0
# >>> c.real
# -5.0

#######  进制转换
#接收一个整型，输出一个str类型
# bin
# oct
# hex
#接收一个int/str， 返回一个int类型
# int
# >>> b = 0b11
# >>> type(b)
# <class 'int'>
# >>> c = 0xe
# >>> c
# 14
# >>> bin(10)
# '0b1010'
# >>> bin(0o7)
# '0b111'
# >>> type(bin(10))
# <class 'str'>
# >>> s = "3"
# >>> int(s)
# 3
# >>> type(int(s))
# <class 'int'>
# >>> s = 0b11
# >>> int(s)
# 3
# >>> s = "0b11"
# >>> int(s, base=2)
# 3


#float 不精确
#decimal 精确
# >>> from decimal import Decimal
# >>> mydec = Decimal.from_float(12.222)
# >>> mydec
# Decimal('12.2219999999999995310417943983338773250579833984375')
# >>> mydec2 = Decimal('3.14')
# >>> mydec2
# Decimal('3.14')